package net.cherrylab.component
{
	import flash.display.BitmapData;
	import flash.display.Sprite;
	
	public class Particle extends Sprite
	{
		
		private var radius:Number; 
		private var color:uint;
		private var _vx:Number = 0; 
		private var _vy:Number = 0; 
		private var _mass:Number = 1; 
		
		public function Particle()
		{
			
		}
		
		public function Ball(radius:Number=35, color:uint=0x00ffff):void
		{ 
			//随机半径5~39
			this.radius = Math.floor(Math.random()*radius+5); 
			this.color = color; 
			init(); 
		} 
		private function init():void { 
			graphics.beginFill(color); 
			graphics.drawCircle(0, 0, radius); 
			graphics.endFill(); 
		} 
		
		private function onDraw():BitmapData
		{
			
			var bd:BitmapData=new BitmapData(this.width,this.height,true,0);
			bd.draw(this);
			
			return bd;
		}// end function
		
		/**
		 * 质量
		 * */
		public function get mass():Number
		{
			return _mass;
		}
		
		/**
		 * @private
		 */
		public function set mass(value:Number):void
		{
			_mass = value;
		}
		
		/**
		 * y坐标速度
		 * */
		public function get vy():Number
		{
			return _vy;
		}
		
		/**
		 * @private
		 */
		public function set vy(value:Number):void
		{
			_vy = value;
		}
		
		/**
		 * x坐标速度
		 * */
		public function get vx():Number
		{
			return _vx;
		}
		
		/**
		 * @private
		 */
		public function set vx(value:Number):void
		{
			_vx = value;
		}
		
		
	} 
} 